package com.awx.client.navigation.menu;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JMenuBar;

import com.awx.client.navigation.AwxController;

public class AwxMenuConfiguration implements Serializable {

	private List<AwxMenuGroup> menuGroups;

	public AwxMenuConfiguration() {
		this.menuGroups = new ArrayList<AwxMenuGroup>();
	}

	public void addMenuGroup( AwxMenuGroup group ) {
		this.menuGroups.add( group );
	}

	public JMenuBar buildMenuBar(AwxController controller) {
		JMenuBar menuBar = new JMenuBar();
		for (AwxMenuGroup menuGroup : this.menuGroups) {
			menuBar.add( menuGroup.buildMenu( controller ) );
		}
		return menuBar;
	}
}
